<!DOCTYPE html>
<html>
<head>
    

    

    
<!-- Baidu Tongji -->
<script>var _hmt = _hmt || []</script>
<script async src="//hm.baidu.com/hm.js?a7c05ce530152d9866930ef4850ee566"></script>
<!-- End Baidu Tongji -->




    <meta charset="utf-8">
    
    
    
    <title>神奇的鸭鸭の码农库 | 新知识要不断的总结记录成笔记，要多写，多画，能够清晰透彻的将知识讲给别人听，才是达到理解的层次。</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#765959">
    
    
    <meta name="keywords" content="">
    <meta property="og:type" content="website">
<meta property="og:title" content="神奇的鸭鸭の码农库">
<meta property="og:url" content="http://magic_duck.oschina.io/index.html">
<meta property="og:site_name" content="神奇的鸭鸭の码农库">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="神奇的鸭鸭の码农库">
    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="/css/style.css?v=1.4.3">
    <script>window.lazyScripts=[]</script>
</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu"  >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">神奇的鸭鸭</h5>
          <a href="mailto:702038338@qq.com" title="702038338@qq.com" class="mail">702038338@qq.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect active">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                归档
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://git.oschina.net/magic_duck" target="_blank" >
                <i class="icon icon-lg icon-gg-circle"></i>
                码云
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://www.zhihu.com/people/shen-qi-de-ya-ya" target="_blank" >
                <i class="icon icon-lg icon-twitter"></i>
                知乎
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/404.html"  >
                <i class="icon icon-lg icon-link"></i>
                404页面测试
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">神奇的鸭鸭の码农库</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header index-header">

    <div class="container fade-scale">
        <h1 class="title">神奇的鸭鸭の码农库</h1>
        <h5 class="subtitle">
            
                新知识要不断的总结记录成笔记，要多写，多画，能够清晰透彻的将知识讲给别人听，才是达到理解的层次。
            
        </h5>
    </div>

    

</header>

<div class="container body-wrap">

    <ul class="post-list">
    
        <li class="post-list-item fade">
            <article id="post-shiro03"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017年12月05日 0:02" datetime="2017-12-04T16:02:00.000Z"  itemprop="datePublished">2017-12-05</time>

        


        

    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/12/05/shiro03/">shiro(三) 身份认证</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        学习来源：Apache Shiro
Authentication 认证身份验证的过程–也就是证明一个用户的真实身份。为了证明用户身份，需要提供系统理解和相信的身份信息和证据。

用户需要提供用户的身份(principals)和证明(credentials)给shiro，从而来判定是否能通过验证：

Principals(身份)： 是Subject的”标识属性”，一般使用用户名或邮箱地址，唯一...
    

        <a href="/2017/12/05/shiro03/" class="post-more waves-effect waves-button">
            阅读全文...
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/安全/">安全</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-shiro02"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017年12月05日 0:01" datetime="2017-12-04T16:01:30.000Z"  itemprop="datePublished">2017-12-05</time>

        


        

    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/12/05/shiro02/">shiro(二) 架构和配置</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        学习来源：Apache Shiro
Architecture 架构Apache Shiro 设计理念是使程序的安全变得简单直观而易于实现，Shiro的核心设计参照大多数用户对安全的思考模式–如何对某人（或某事）在与程序交互的环境中的进行安全控制。
High-Level Overview 高级概述在概念层，Shiro 架构包含三个主要的理念：Subject,SecurityManager和 R...
    

        <a href="/2017/12/05/shiro02/" class="post-more waves-effect waves-button">
            阅读全文...
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/安全/">安全</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-shiro01"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017年12月05日 0:00" datetime="2017-12-04T16:00:00.000Z"  itemprop="datePublished">2017-12-05</time>

        


        

    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/12/05/shiro01/">shiro(一) 介绍与入门</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        学习来源：Apache Shiro
IntroductionWhat is Apache Shiro?Apache Shiro是一个功能强大、灵活的，开源的安全框架。它可以干净利落地处理身份验证、授权、企业会话管理和加密。
What can Shiro do?
验证用户身份
用户访问权限控制，比如：
判断用户是否分配了一定的安全角色。
判断用户是否被授予完成某个操作的权限


在非 web ...
    

        <a href="/2017/12/05/shiro01/" class="post-more waves-effect waves-button">
            阅读全文...
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/安全/">安全</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-tomcat_managerServlet"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017年11月27日 16:39" datetime="2017-11-27T08:39:56.000Z"  itemprop="datePublished">2017-11-27</time>

        


        

    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/11/27/tomcat_managerServlet/">tomcat ManagerServlet阅读源码后的实践</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        介绍源码链接：http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java
ManagerServlet是tomcat的部署源码，通过他我们可以获取tomcat的部分指标，远程管理web应用程序，不过这个功能将受到web应用程序部署描述符中的安...
    

        <a href="/2017/11/27/tomcat_managerServlet/" class="post-more waves-effect waves-button">
            阅读全文...
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/源码/">源码</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-grafana_http_api_1"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017年11月20日 0:00" datetime="2017-11-19T16:00:00.000Z"  itemprop="datePublished">2017-11-20</time>

        


        

    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/11/20/grafana_http_api_1/">Grafana-HTTPAPI(1)(Authentication篇+DataSource篇)</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        准备工作准备httpClient工具类，需要用到依赖httpclient 4.3.5,jackson-mapper-asl 1.9.13,slf4j-log4j12 1.7.7：123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585...
    

        <a href="/2017/11/20/grafana_http_api_1/" class="post-more waves-effect waves-button">
            阅读全文...
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/监控平台/">监控平台</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-Metrics"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017年11月13日 0:00" datetime="2017-11-12T16:00:00.000Z"  itemprop="datePublished">2017-11-13</time>

        


        

    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/11/13/Metrics/">Metrics-JVM上的实时监控类库</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        当我们需要为某个系统某个服务做监控、做统计，就需要用到Metrics。举个例子，一个图片压缩服务：

每秒钟的请求数是多少(TPS)?
平均每个请求处理的时间？
请求处理的最长耗时？
等待处理的请求队列的长度？

基本上每一个服务，应用都需要做一个监控系统，这需要尽量以少量的代码，实现统计某类数据的功能。
导入基本使用方式直接将core包导入pom文件即可，配置如下：123456&lt;!-...
    

        <a href="/2017/11/13/Metrics/" class="post-more waves-effect waves-button">
            阅读全文...
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/监控平台/">监控平台</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-java_enhance5_使用序列化实现对象的拷贝"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017年11月09日 10:03" datetime="2017-11-09T02:03:00.000Z"  itemprop="datePublished">2017-11-09</time>

        


        

    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/11/09/java_enhance5_使用序列化实现对象的拷贝/">java提高篇(五) 使用序列化实现对象的拷贝</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        学习来源：http://cmsblogs.com参考资料：http://www.cnblogs.com/DreamDrive/p/4005966.html
浅拷贝问题我们知道在Java中存在Cloneable这个接口，实现该接口的类都会具备被拷贝的能力，同时拷贝是在内存中进行的，在性能方面比我们直接通过new生成对象来的快，特别是在大对象的生成上，使得性能的提升非常明显。但是我们需要注意浅拷...
    

        <a href="/2017/11/09/java_enhance5_使用序列化实现对象的拷贝/" class="post-more waves-effect waves-button">
            阅读全文...
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/java基础/">java基础</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-java_enhance4_四舍五入非小事"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017年11月07日 10:03" datetime="2017-11-07T02:03:00.000Z"  itemprop="datePublished">2017-11-07</time>

        


        

    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/11/07/java_enhance4_四舍五入非小事/">java提高篇(四) 四舍五入非小事</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        学习来源：http://cmsblogs.com
代码引入12345678public static void main(String[] args) &#123;    System.out.println("12.5的四舍五入值：" + Math.round(12.5));    System.out.println("-12.5的四舍五入值：" + Math.round(-12.5))...
    

        <a href="/2017/11/07/java_enhance4_四舍五入非小事/" class="post-more waves-effect waves-button">
            阅读全文...
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/java基础/">java基础</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-SSM"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017年10月24日 23:20" datetime="2017-10-24T15:20:00.000Z"  itemprop="datePublished">2017-10-24</time>

        


        

    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/10/24/SSM/">SSM框架执行流程</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        今天有公司打电话过来面试，期间问到了SSM框架的执行流程，由于没有什么准备，回答的不太好，所以吃完饭变回来总结总结。
对SSM框架理解Spring有什么用？Spring是一个轻量级的框架，他提供控制反转(IOC)[对象都是从spring容器中拿]，依赖注入(DI)[松耦合，使对象无需知道依赖的来源和具体实现]，面向切面编程(AOP)[松耦合，使业务和逻辑隔离，提高代码重用性，提高开发效率]。...
    

        <a href="/2017/10/24/SSM/" class="post-more waves-effect waves-button">
            阅读全文...
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/SSM/">SSM</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-java_enhance3_多态"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017年10月23日 10:03" datetime="2017-10-23T02:03:00.000Z"  itemprop="datePublished">2017-10-23</time>

        


        

    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/10/23/java_enhance3_多态/">java提高篇(三) 理解java的三大特性之多态</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        学习来源：http://cmsblogs.com
多态封装隐藏了他的内部实现机制，可以在不影响使用的情况下改变类的内部结构，同时也保护了数据。对外界他的实现细节是隐藏的，暴露给外界的只是他的访问方法。
继承是为了复用父类代码，两个类如果存在is-a的关系就可以使用继承。同时继承也为多态做了铺垫。那么多态是什么，多态的实现机制又是什么？下面会为你揭开： 不多态是指程序中定义的引用变量所指向的具...
    

        <a href="/2017/10/23/java_enhance3_多态/" class="post-more waves-effect waves-button">
            阅读全文...
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/java基础/">java基础</a></li></ul>

    </div>
    
</article>

        </li>
    
    </ul>

    
<nav id="page-nav">
    <div class="inner">
    <span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="page-number" href="/page/3/">3</a><span class="space">&hellip;</span><a class="page-number" href="/page/8/">8</a><a class="extend next" rel="next" href="/page/2/">下一页</a>
    </div>
</nav>


</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            <span><a href="" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            <span>博客内容遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">知识共享 署名 - 非商业性 - 相同方式共享 4.0协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p>
            <span>Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://git.oschina.net/z77z" target="_blank">邹海清</a></span>
            <span>神奇的鸭鸭の码农库 &copy; 2017</span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://magic_duck.oschina.io/&title=神奇的鸭鸭の码农库&pic=http://magic_duck.oschina.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://magic_duck.oschina.io/&title=神奇的鸭鸭の码农库&source=" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://magic_duck.oschina.io/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=神奇的鸭鸭の码农库&url=http://magic_duck.oschina.io/&via=http://magic_duck.oschina.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://magic_duck.oschina.io/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="//api.qrserver.com/v1/create-qr-code/?data=http://magic_duck.oschina.io/" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: false };



lazyScripts.push('//s95.cnzz.com/z_stat.php?id=1261081671&web_id=1261081671')

</script>

<script src="/js/main.min.js?v=1.4.3"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="/js/search.min.js?v=1.4.3" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>


</body>
</html>
